﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<head>
<%@ include file="/include/include.jsp" %>
</head>

<body>
	
	<%@ include file="/include/header.jsp" %>

	<%@ include file="/include/menu.jsp" %>
	
	<div id="mainContent">
		<h2><a href="${ctx}/${menu.url}">${menu.description}</a>&nbsp;-&nbsp;<a href="${ctx}/${empty currViewBarSubMenu_ ? submenu.url : currViewBarSubMenu_.url}">${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description}</a></h2>
		<!-- display="ROLE_SALES ROLE_ADMIN" -->
		<div class="tool-bar">
			<!-- <a href="${ctx}/house/housematerial/search" class="modal-window modal-link"  >添加${submenu.description}</a> -->
			<!--<div title="${menu.description} - ${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description} - 导入${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description}"  href="${ctx}/warehouse/stock/import" class="modal-window modal-link">导入仓储产品</div>
			<div title="${menu.description} - ${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description} - 查询${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description}"  href="${ctx}/warehouse/stock/search" class="modal-window modal-link">过滤查询</div>
			--><!--<div title="${menu.description} - ${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description} - 排序${empty currViewBarSubMenu_ ? submenu.description : currViewBarSubMenu_.description}"  href="${ctx}/warehouse/stock/order" class="modal-window modal-link">排序方式</div>
		-->
		<a href="${ctx }/modify/stock/export">导出实时库存报表</a>
		</div>
		<form action="${ctx}/warehouse/stock/waresearch" method="post" id="warehouseForm">
			<h2>仓储编号 :&nbsp;&nbsp; <a href="#" onclick="$('warehouseForm').submit();">${warehouse.code }</a>&nbsp;-&nbsp;仓储名称 :&nbsp;&nbsp;<a href="#" onclick="$('warehouseForm').submit();">${warehouse.name}</a>
			
			</h2>
			<input type="hidden" name="warehouse.code" value="${warehouse.code }"/>
			<input type="hidden" name="warehouse.name" value="${warehouse.name }"/>
		</form>
		
		<div class="grid-list">
			<table class="grid" cellspacing="0" url="${ctx}/warehouse/stock/list">
				<thead>
					<tr>
						<td orderBy_="inventory.product.productCategory.categoryName" class="${orderParameters['inventory.product.productCategory.categoryName']}">产品类别</td>
						<td orderBy_="inventory.product.productCode" class="${orderParameters['inventory.product.productCode']}">产品编号</td>
						<td orderBy_="inventory.product.productName" class="${orderParameters['inventory.product.productName']}">产品名称</td>
						<td>现有数量 </td>
						<td>约定数量</td>
						<td>虚拟数量</td>
						<td>已出库数量</td>
						<td>预警</td>
						<td>调货信息</td>
					</tr>
				</thead>
				<tbody>
					<c:forEach var="inventory" items="${inventorys}">
						
						<tr onmouseover="this.style.backgroundColor= '#A0CFEC'" class='${inventory.className}' onmouseout="this.style.backgroundColor= '#ffffff'" ${ inventory.inventoryWarningRecord != null ? 'class="errors" ' : ''}>
							<td>${inventory.product.productCategory.categoryName}</td>
							<td>${inventory.product.productCode}</td>
							<td>${inventory.product.productName}</td>
							
							<td>${inventory.amount}</td>
							<td>${inventory.agreementAmount}</td>
							<td>${inventory.virtualAmount}</td>
							<td>${inventory.outAmount}</td>
							<td>
								<c:if test="${inventory.inventoryWarningRecord != null}">
									<c:if test="${!inventory.inventoryWarningRecord.raedWarning}">
										
										<div title="查看预警信息"  href="${ctx}/warehouse/warning/${inventory.inventoryWarningRecord.id}/view" class="modal-window modal-link"> 
											<img src="${ctx}/static/images/unread.png"  border="0" alt="" />
										</div>
									</c:if>
									<c:if test="${inventory.inventoryWarningRecord.raedWarning}">
										
										<div title="查看预警信息"  href="${ctx}/warehouse/warning/${inventory.inventoryWarningRecord.id}/view" class="modal-window modal-link"> 
											<img src="${ctx}/static/images/read.png"  border="0" alt="" />
										</div>
									</c:if>
								</c:if>
							</td>
							<td>
								<c:if test="${inventory.exchangeInventory >= 0 }">
									<div class="info">
										<span>
											<a href="${ctx}/warehouse/exchange/${inventory.id}/inventory">	
												+${inventory.exchangeInventory}
											</a>	
										</span>
									</div>
								</c:if>
								
								<c:if test="${inventory.exchangeInventory < 0 }">
									<div class="error">
										<span>	
											<a href="${ctx}/warehouse/exchange/${inventory.id}/inventory">	
												${inventory.exchangeInventory}
											</a>	
										</span>
									</div>
								</c:if>
							</td>
					</tr>
					</c:forEach>
				</tbody>
			</table>
			<t:page action="${ctx}/warehouse/stock/list" />
		</div>
	</div>
	
	<%@ include file="/include/script.jsp" %>
	
</body>

</html> 